package com.example.administrator.customview;

import android.os.Bundle;
import android.os.SystemClock;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {
    private CircleProgressView CircleProgress_View;
    //已完成进度
    private int totalProgress;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        CircleProgress_View= (CircleProgressView) findViewById(R.id.CircleProgress_View);

        totalProgress=50;
        new Thread(new Runnable() {
            @Override
            public void run() {
               //设置进度从0开始
                CircleProgress_View.setProgressSize(0);
                for (int i = 0; i <totalProgress ; i++) {
                    CircleProgress_View.setProgressSize(i+1);
                    SystemClock.sleep(30);
                    CircleProgress_View.postInvalidate();
                }
            }
        }).start();
    }
}
